# -*- coding: utf-8 -*-

###############################################################################
#    KShootout - online shootout card game.                                   #
#    Copyright (C) 2008, 2009  MacJariel                                      #
#                                                                             #
#    KShootout is free software: you can redistribute it and/or modify        #
#    it under the terms of the GNU General Public License as published by     #
#    the Free Software Foundation, either version 3 of the License, or        #
#    (at your option) any later version.                                      #
#                                                                             #
#    KShootout is distributed in the hope that it will be useful,             #
#    but WITHOUT ANY WARRANTY; without even the implied warranty of           #
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
#    GNU General Public License for more details.                             #
#                                                                             #
#    You should have received a copy of the GNU General Public License        #
#    along with KShootout.  If not, see <http://www.gnu.org/licenses/>.       #
###############################################################################

from kshootoutcommon import *

ServerEvents = []

se = ServerEvent("EnterGame", "enter-game")
se["doxyString"] = (
                    "The enter-game event is sent to client after it request to "
                    "enter the game and its request is acknowledged. Server "
                    "sends the game-sync structure to allow the client to "
                    "synchronize and also the actor-id."
                   )
se["complexMembers"].append(Member("GameSyncData", "gameSyncData", "game-sync", ""))
se["simpleMembers"].append(Member("ActorId", "actorId", "actor-id", "The actor id."))
ServerEvents.append(se)

se = ServerEvent("ExitGame", "exit-game")
se["simpleMembers"].append(Member("GameId", "gameId", "game-id", "", "0"))
ServerEvents.append(se)

se = ServerEvent("CreatePlayer", "create-player")
se["simpleMembers"].append(Member("GameId", "gameId", "game-id", "", "0"))
se["complexMembers"].append(Member("PlayerData", "playerData", "player", ""))
ServerEvents.append(se)

se = ServerEvent("RemovePlayer", "remove-player")
se["simpleMembers"].append(Member("GameId", "gameId", "game-id", "", "0"))
se["simpleMembers"].append(Member("PlayerId", "playerId", "player-id", "", "0"))
ServerEvents.append(se)

se = ServerEvent("ChatMessage", "chat-message")
se["simpleMembers"].append(Member("GameId", "gameId", "game-id", "", "0"))
se["simpleMembers"].append(Member("ClientId", "clientId", "client-id", "", "0"))
se["simpleMembers"].append(Member("PlayerId", "playerId", "player-id", "", "0"))
se["simpleMembers"].append(Member("QString", "senderName", "sender-name", ""))
se["simpleMembers"].append(Member("QString", "text", "text", ""))
ServerEvents.append(se)

se = ServerEvent("GameUpdate", "game-update")
se["flaggedMembers"] = True
se["simpleMembers"].append(Member("GameId", "gameId", "game-id", "", "0"))
se["simpleMembers"].append(Member("bool", "isStartable", "is-startable", "", "0", True))
ServerEvents.append(se)
